package com.bishe.controller;

import com.bishe.controller.utils.R;
import com.bishe.domain.Bulletin;
import com.bishe.domain.Help;
import com.bishe.sevice.IHelpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//@CrossOrigin
@RestController
@RequestMapping("/help")
public class HelpController {

    @Autowired
    private IHelpService iHelpService;

    @GetMapping
    public R getAll(){
        return new R(true,iHelpService.list());
    }

    @PostMapping
    public R save(@RequestBody Help help){
        return new R(iHelpService.save(help));
    }

    @DeleteMapping("{id}")
    public R delete(@PathVariable Integer id){
        return new R(iHelpService.delete(id));
    }
}
